<template>
    <div>
      {{state}}
      <shouye @change="setchange"></shouye>
      <user :con="con" @setstate="State" :user="user"></user>
    </div>
</template>
<script>
//<!--父传子  绑定属性-->
    module.exports = {
        name:'App',
        components:{
          shouye:httpVueLoader('./src/views/index/index.vue'),
          user:httpVueLoader('./src/views/user/user.vue')
        },
        data(){
          return{
            user:{},
            state:'未登录',
            con:0
          }
        },
        created(){
          this.getUserInfo()
          console.log(this)
        },
        methods:{
          getUserInfo(){
            let user = {
              pic:'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3277870098,1272922089&fm=26&gp=0.jpg',
              name:'你好世界'
            }
            this.user = user
          },
          State(e){
            console.log('执行了',e)
            this.state = e
          },
          setchange(e){
            console.log(e)
            this.con = e
          }
        }
        ,watch:{

        },
        computed:{

        }
    }
</script>
<style>

</style>
